All Questions
4 questions
2votes
3answers
558views
In c++, is there a way inside a function block, to execute cleanup code after the value has been returned?
Backstory (You can skip) I am building an API for managing Files and Directories in a consistent manner across a project. This is for deduplication and consistency when performing a task, and in this ...
0votes
1answer
1kviews
In Qt or C++, is there a good means for creating a switch with dynamically generated cases, or should I just use a for loop (or something else)?
Presume this situation: Max Number of 256 key slots. Key slots are defined by a struct, and a variable for each (256) has to exist. User defines which keys slots are active at initiation (in my ...
5votes
2answers
4kviews
How to facilitate thread-safe access to large set of shared variables?
I have 2 sets--inputs and outputs--of 70 32-bit integer variables and 70 bools (140 vars altogether). These need to be accessed and modified from 3 threads. What is an appropriate design pattern to ...
4votes
2answers
7kviews
C++ Typecasting VS performance
Let's say we're designing a video game. We have some sprites on the map and we want to call some method of the particular sprite at some particular position. We are using one broadly-known C++ ...